package cn.nebula.music.converter;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;

import cn.nebula.music.dao.PictureDAO;
import cn.nebula.music.domain.Picture;

@Component
public class StringToPictureConverter implements Converter<String,Picture>{

	@Autowired
	private PictureDAO pictureDAO;

	@Override
	public Picture convert(String source) {
		return pictureDAO.findPictureById(Integer.valueOf(source));
	}
	
	
}
